package cn.itsource.controller.remote;

import cn.dev33.satoken.annotation.SaIgnore;
import cn.itsource.api.openfeign.ILoginOpenFeignClient;
import cn.itsource.pojo.domain.Login;
import cn.itsource.pojo.dto.LoginRoToLoginDto;
import cn.itsource.pojo.ro.LoginRo;
import cn.itsource.result.JSONResult;
import cn.itsource.service.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class LoginOpenFeignClientImpl implements ILoginOpenFeignClient {
    @Autowired
    private ILoginService loginService;
    @Override
    @SaIgnore
    public JSONResult createLogin(LoginRo loginRo) {
        Login login = LoginRoToLoginDto.to(loginRo); //封装了一个方法进行 对象的转换
        loginService.save(login);
        return JSONResult.success();
    }
}
